#ifndef Clock_h__
#define Clock_h__
#include "Common.h"

class Clock {
	int m_running;

	int m_thisTime;
	int m_lastTime;

	int m_systemTime;
	int m_systemOffset;
	int m_pauseTime;

	int m_frameCount;
	int m_frameStart;
	int m_frameEnd;

	int m_simTime;
	int m_simOffset;

public:

	Clock();
	~Clock();

	void Reset();
	int IsRunning() { return m_running; }
	void Run();
	void Stop();

	void Update();
	void BeginFrame();

	int GetSystem() { Update(); return m_systemTime; }
	int GetTime() { return m_simTime; }
	int GetFrame() { return m_frameCount; }
	int GetFrameStart() { return m_frameStart; }
	int GetFrameEnd() { return m_frameEnd; }

	void AdvanceTo(int newTime);
	void AdvanceToEnd();
};

#endif // Clock_h__